package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbSpeakersMapper;
import com.ruoyi.teach.domain.NbSpeakers;
import com.ruoyi.teach.service.INbSpeakersService;

/**
 * 课程主讲人/助教Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbSpeakersServiceImpl implements INbSpeakersService 
{
    @Autowired
    private NbSpeakersMapper nbSpeakersMapper;

    /**
     * 查询课程主讲人/助教
     * 
     * @param id 课程主讲人/助教主键
     * @return 课程主讲人/助教
     */
    @Override
    public NbSpeakers selectNbSpeakersById(Long id)
    {
        return nbSpeakersMapper.selectNbSpeakersById(id);
    }

    /**
     * 查询课程主讲人/助教列表
     * 
     * @param nbSpeakers 课程主讲人/助教
     * @return 课程主讲人/助教
     */
    @Override
    public List<NbSpeakers> selectNbSpeakersList(NbSpeakers nbSpeakers)
    {
        return nbSpeakersMapper.selectNbSpeakersList(nbSpeakers);
    }

    /**
     * 新增课程主讲人/助教
     * 
     * @param nbSpeakers 课程主讲人/助教
     * @return 结果
     */
    @Override
    public int insertNbSpeakers(NbSpeakers nbSpeakers)
    {
        nbSpeakers.setCreateTime(DateUtils.getNowDate());
        return nbSpeakersMapper.insertNbSpeakers(nbSpeakers);
    }

    /**
     * 修改课程主讲人/助教
     * 
     * @param nbSpeakers 课程主讲人/助教
     * @return 结果
     */
    @Override
    public int updateNbSpeakers(NbSpeakers nbSpeakers)
    {
        nbSpeakers.setUpdateTime(DateUtils.getNowDate());
        return nbSpeakersMapper.updateNbSpeakers(nbSpeakers);
    }

    /**
     * 批量删除课程主讲人/助教
     * 
     * @param ids 需要删除的课程主讲人/助教主键
     * @return 结果
     */
    @Override
    public int deleteNbSpeakersByIds(Long[] ids)
    {
        return nbSpeakersMapper.deleteNbSpeakersByIds(ids);
    }

    /**
     * 删除课程主讲人/助教信息
     * 
     * @param id 课程主讲人/助教主键
     * @return 结果
     */
    @Override
    public int deleteNbSpeakersById(Long id)
    {
        return nbSpeakersMapper.deleteNbSpeakersById(id);
    }
}
